﻿@{
    Layout = "~/Views/Shared/_FormWhite.cshtml";
}
<style type="text/css">
    img {
        max-height: 100px;
        max-width: 100px;
    }
</style>
<div class="wrapper animated fadeInRight">
    <form id="form" class="form-horizontal m">
        <div class="form-group">
            <label class="col-sm-2 control-label ">环保号牌<font class="red"> *</font></label>
            <div class="col-sm-4">
                <input id="huanBaoCode" col="HuanBaoCode" type="text" class="form-control" readonly />
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>所有人信息 </h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">所有人<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="ownerName" col="OwnerName" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">联系电话<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="ownerTel" col="OwnerTel" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">证件号码<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="ownerCardNo" col="OwnerCardNo" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">联系地址<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="ownerAddr" col="OwnerAddr" type="text" class="form-control" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>机械信息 </h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">登记类型<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <div id="jXDJLX" col="JXDJLX"></div>
                            </div>
                            <label class="col-sm-2 control-label ">机械类别<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <div id="jXLB" col="JXLB"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">排放阶段<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <div id="pFJD" col="PFJD"></div>
                            </div>
                            <label class="col-sm-2 control-label ">燃料类型<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <div id="rLLX" col="RLLX"></div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">机械型号<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="jXXH" col="JXXH" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">出厂编号<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="jXCCBH" col="JXCCBH" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">制造企业<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="jXZZQY" col="JXZZQY" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">出厂日期<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="jXCCRQ" col="JXCCRQ" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">机械环保代码<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="jXHBDM" col="JXHBDM" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">环保信息公开编号<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="hBXXGKBH" col="HBXXGKBH" type="text" class="form-control" />
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label ">VIN/PIN<font class="red"> *</font></label>
                            <div class="col-sm-10">
                                <input id="jXVIN" col="JXVIN" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">原有号牌<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="yYHP" col="YYHP" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">场内号牌<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="cNHP" col="CNHP" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">GPS号码<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="gpsNo" col="GpsNo" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">其它号码<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="other_number" col="other_number" type="text" class="form-control" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>发动机信息 </h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">发动机型号<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="fDJXH" col="FDJXH" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">发动机编号<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="fDJBH" col="FDJBH" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">额定功率(kw)<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="fDJGL" col="FDJGL" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">额定转速 (r/min)<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="fDJZS" col="FDJZS" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">制造企业<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="fDJZZQY" col="FDJZZQY" type="text" class="form-control" />
                            </div>
                            <label class="col-sm-2 control-label ">出厂日期<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <input id="fDJCCRQ" col="FDJCCRQ" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">发动机型式核准证号<font class="red"> *</font></label>
                            <div class="col-sm-10">
                                <input id="fDJXSHZZH" col="FDJXSHZZH" type="text" class="form-control" />
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label ">铭牌照片<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <a href="#" class="thumbnail">
                                    <img src="/image/NoImg.jpg" id="img_FDJMP_pic">
                                </a>
                                <input id="fDJMP_pic" col="FDJMP_pic" type="hidden" />
                            </div>
                            <label class="col-sm-2 control-label ">型式核准证书照片<font class="red"> *</font></label>
                            <div class="col-sm-4">
                                <a href="#" class="thumbnail">
                                    <img src="/image/NoImg.jpg" id="img_FDJXSHZZS_pic">
                                </a>
                                <input id="fDJXSHZZS_pic" col="FDJXSHZZS_pic" type="hidden" />
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>照片 </h5>
                    </div>
                    <div class="ibox-content">
                        <div class="form-group">
                            <div class="col-sm-4">
                                <div class="thumbnail">
                                    <img src="/image/NoImg.jpg" id="img_OwnerCard_Pic">
                                    <div class=" caption">
                                        <p>身份证照片</p>
                                    </div>
                                    </a>
                                    <input id="ownerCard_Pic" col="OwnerCard_Pic" type="hidden" class="form-control" readonly />
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-4">
                                    <div class="thumbnail">
                                        <img src="/image/NoImg.jpg" id="img_JX1_pic">
                                        <div class=" caption">
                                            <p>正面照片</p>
                                        </div>
                                    </div>
                                    <input id="jX1_pic" col="JX1_pic" type="hidden" class="form-control" />
                                </div>
                                <div class="col-sm-4">
                                    <a href="#" class="thumbnail">
                                        <img src="/image/NoImg.jpg" id="img_JX2_pic">
                                        <div class=" caption">
                                            <p>侧面照片</p>
                                        </div>
                                    </a>
                                    <input id="jX2_pic" col="JX2_pic" type="hidden" class="form-control" />
                                </div>
                                <div class="col-sm-4">
                                    <a href="#" class="thumbnail">
                                        <img src="/image/NoImg.jpg" id="img_JX3_pic">
                                        <div class=" caption">
                                            <p>背面照片</p>
                                        </div>
                                    </a>
                                    <input id="jX3_pic" col="JX3_pic" type="hidden" class="form-control" />
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-3">
                                    <a href="#" class="thumbnail">
                                        <img src="/image/NoImg.jpg" id="img_JXMP_pic">
                                        <div class=" caption">
                                            <p>机械铭牌照片</p>
                                        </div>
                                    </a>
                                    <input id="jXMP_pic" col="JXMP_pic" type="hidden" class="form-control" />
                                </div>
                                <div class="col-sm-3">
                                    <a href="#" class="thumbnail">
                                        <img src="/image/NoImg.jpg" id="img_HBBQ_pic">
                                        <div class=" caption">
                                            <p>环保标签照片</p>
                                        </div>
                                    </a>
                                    <input id="hBBQ_pic" col="HBBQ_pic" type="hidden" class="form-control" />
                                </div>
                                <div class="col-sm-3">
                                    <a href="#" class="thumbnail">
                                        <img src="/image/NoImg.jpg" id="img_JXHBDM_pic">
                                        <div class=" caption">
                                            <p>机械环保代码照片</p>
                                        </div>
                                    </a>
                                    <input id="jXHBDM_pic" col="JXHBDM_pic" type="hidden" class="form-control" />
                                </div>
                                <div class="col-sm-3">
                                    <a href="#" class="thumbnail">
                                        <img src="/image/NoImg.jpg" id="img_other_pic">
                                        <div class=" caption">
                                            <p>其它照片</p>
                                        </div>
                                    </a>
                                    <input id="other_pic" col="other_pic" type="hidden" class="form-control" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div style="display:none;" class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>审核信息 </h5>
                        </div>
                        <div class="ibox-content">
                            <div class="form-group">
                                <label class="col-sm-2 control-label ">审核状态<font class="red"> *</font></label>
                                <div class="col-sm-4">
                                    <select id="checkStatus" col="checkStatus" class="form-control" readonly>
                                        <option value="1">已审核</option>
                                        <option value="0">未审核</option>
                                        <option value="9">已驳回</option>
                                    </select>
                                </div>
                                <label class="col-sm-2 control-label ">审核人<font class="red"> *</font></label>
                                <div class="col-sm-4">
                                    <input id="checkPerson" col="checkPerson" type="text" class="form-control" readonly />
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label ">审核说明<font class="red"> *</font></label>
                                <div class="col-sm-4">
                                    <input id="checkDesc" col="checkDesc" type="text" class="form-control" readonly />
                                </div>

                                <label class="col-sm-2 control-label ">审核时间<font class="red"> *</font></label>
                                <div class="col-sm-4">
                                    <input id="checkDate" col="checkDate" type="text" class="form-control" readonly />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div style="display:none;">
                <div class="form-group">
                    <label class="col-sm-2 control-label ">固定源型号<font class="red"> *</font></label>
                    <div class="col-sm-2">
                        <input id="gdy_xh" col="gdy_xh" type="text" class="form-control" readonly />
                    </div>
                    <label class="col-sm-2 control-label ">固定源额定功率<font class="red"> *</font></label>
                    <div class="col-sm-2">
                        <input id="gdy_edgl" col="gdy_edgl" type="text" class="form-control" readonly />
                    </div>
                    <label class="col-sm-2 control-label ">固定源额定电流<font class="red"> *</font></label>
                    <div class="col-sm-2">
                        <input id="gdy_eddl" col="gdy_eddl" type="text" class="form-control" readonly />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label ">固定源编号<font class="red"> *</font></label>
                    <div class="col-sm-4">
                        <input id="gdy_bh" col="gdy_bh" type="text" class="form-control" />
                    </div>
                    <label class="col-sm-2 control-label ">固定源额定电压<font class="red"> *</font></label>
                    <div class="col-sm-4">
                        <input id="gdy_eddy" col="gdy_eddy" type="text" class="form-control" />
                    </div>
                </div>
                <div class="form-group">

                    <label class="col-sm-2 control-label ">固定源相数<font class="red"> *</font></label>
                    <div class="col-sm-4">
                        <input id="gdy_xs" col="gdy_xs" type="text" class="form-control" />
                    </div>
                </div>
            </div>

            <div style="display:none;">
                <div class="form-group">
                    <label class="col-sm-2 control-label ">附加说明<font class="red"> *</font></label>
                    <div class="col-sm-2">
                        <input id="fJXX" col="FJXX" type="text" class="form-control" readonly />
                    </div>
                    <label class="col-sm-2 control-label ">创建时间<font class="red"> *</font></label>
                    <div class="col-sm-2">
                        <input id="baseCreateTime" col="BaseCreateTime" type="text" class="form-control" readonly />
                    </div>
                    <label class="col-sm-2 control-label ">创建人<font class="red"> *</font></label>
                    <div class="col-sm-2">
                        <input id="baseCreatorId" col="BaseCreatorId" type="text" class="form-control" readonly />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label ">修改时间<font class="red"> *</font></label>
                    <div class="col-sm-4">
                        <input id="baseModifyTime" col="BaseModifyTime" type="text" class="form-control" />
                    </div>
                    <label class="col-sm-2 control-label ">修改人<font class="red"> *</font></label>
                    <div class="col-sm-4">
                        <input id="baseModifierId" col="BaseModifierId" type="text" class="form-control" />
                    </div>
                </div>
                <div class="form-group">

                    <label class="col-sm-2 control-label ">版本号<font class="red"> *</font></label>
                    <div class="col-sm-4">
                        <input id="baseVersion" col="BaseVersion" type="text" class="form-control" />
                    </div>
                </div>
            </div>
    </form>
</div>

<script type="text/javascript">
    var id = ys.request("id");
    $(function () {
        $("#jXDJLX").ysComboBox({
            data: top.getDataDict("JXDJLX"),
            key: "DictKey",
            value: "DictValue",
            class: "form-control",
            disabled: true
        });
        $("#jXLB").ysComboBox({
            data: top.getDataDict("JXLB"),
            key: "DictKey",
            value: "DictValue",
            class: "form-control",
            disabled: true
        });
        $("#pFJD").ysComboBox({
            data: top.getDataDict("PFJD"),
            key: "DictKey",
            value: "DictValue",
            class: "form-control",
            disabled: true
        });
        $("#rLLX").ysComboBox({
            data: top.getDataDict("RLLX"),
            key: "DictKey",
            value: "DictValue",
            class: "form-control",
            disabled: true
        });
        getForm();

        $('#form').validate({
            rules: {
                ownerName: { required: true }
            }
        });
    });

    function getForm() {
        if (id > 0) {
            ys.ajax({
                url: '@Url.Content("~/YiDongYuan/DetectionMechanics/GetFormJson")' + '?id=' + id,
                type: 'get',
                success: function (obj) {
                    if (obj.Tag == 1) {
                        $('#form').setWebControls(obj.Data);
                        if (obj.Data.OwnerCard_Pic) {//img_OwnerCard_Pic
                            $("#img_OwnerCard_Pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.OwnerCard_Pic)
                        }
                        if (obj.Data.FDJMP_pic) {
                            $("#img_FDJMP_pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.FDJMP_pic);
                        }
                        if (obj.Data.FDJXSHZZS_pic) {
                            $("#img_FDJXSHZZS_pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.FDJXSHZZS_pic)
                        }
                        if (obj.Data.JX1_pic) {
                            $("#img_JX1_pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.JX1_pic)
                        }
                        if (obj.Data.JX2_pic) {
                            $("#img_JX2_pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.JX2_pic)
                        }
                        if (obj.Data.JX3_pic) {
                            $("#img_JX3_pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.JX3_pic)
                        }
                        if (obj.Data.JXMP_pic) {
                            $("#img_JXMP_pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.JXMP_pic)
                        }
                        if (obj.Data.HBBQ_pic) {
                            $("#img_HBBQ_pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.HBBQ_pic)
                        }
                        if (obj.Data.JXHBDM_pic) {
                            $("#img_JXHBDM_pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.JXHBDM_pic)
                        }
                        if (obj.Data.other_pic) {
                            $("#img_other_pic").attr('src', 'https://jxhfd-api.sxxmlg.cn/File/Show?id=' + obj.Data.other_pic)
                        }
                        $("img").click(function () {
                            var src = $(this).attr('src');
                            var id = src.substr(src.indexOf('=') + 1);
                            window.open("/YiDongYuan/BaseFile/ShowImg?id=" + id);
                        });
                    }
                }
            });
        }
        else {
            var defaultData = {};
            $('#form').setWebControls(defaultData);
        }
    }

       function saveForm(index) {
        if ($('#form').validate().form()) {
            var postData = $('#form').getWebControls({ Id: id });
            ys.ajax({
                 url: '@Url.Content("~/YiDongYuan/DetectionMechanics/SaveFormJson")',
                type: 'post',
                data: postData,
                success: function (obj) {
                    if (obj.Tag == 1) {
                        ys.msgSuccess(obj.Message);
                        parent.searchGrid();
                        parent.layer.close(index);
                    }
                    else {
                        ys.msgError(obj.Message);
                    }
                }
            });
        }
    }
</script>

